'''
dionysus - a web based dialogue management framework
Copyright (C) 2011  Eugeniu Costetchi <eugeniu.costetchi (at) tudor.lu>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Created on Feb 11, 2011

'''
from DialogueManager.planning.PlanFragment import Plan
from DialogueManager.planning.Action import SayInteractionAction,\
    ListenInteractionAnction, SayTemplateInteractionAction
from DialogueManager.planning.Operator import And, Or, Length
from DialogueManager.utils.properties import PLAN_RESOURCE_FILE


# tag to action class mapping
ACTION_MAPPING = {'say':SayInteractionAction,
                  'say_template':SayTemplateInteractionAction, 
                  'listen':ListenInteractionAnction,
                  }
#tag to operator class mapping
OPERATOR_MAPPING = {'and':And,
                    'or':Or,
                    'len':Length,
                    }
#maybe not so good idea to have plans in xml format, what for?
def read_plan():
    ''' maybe not so good idea to have plans in xml format, what for? '''
    result = Plan()
    with open(PLAN_RESOURCE_FILE) as data_source:
        pass
    return result

def _read_fragment():
    pass

def _read_condition():
    pass

def _read_while():
    pass